package com.xs.mvc.common;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang.StringUtils;

/**
 * @Title:
 *         <P>
 *         Ajax.java
 *         </P>
 * @Package
 *          <P>
 *          com.xs.mvc.common
 *          </P>
 * @Description:
 *               <P>
 *               Ajax
 *               </P>
 * @author renweiping
 * @date 2019年1月30日 下午6:16:21
 * @version 1.0
 */

public class Ajax {

	public static  boolean isAjaxRequestInternal(HttpServletRequest req) {

		if (!StringUtils.isBlank(req.getHeader("x-requested-with"))
				&& req.getHeader("x-requested-with").equals("XMLHttpRequest")) {
			return true;
		} else {
			return false;
		}
	}
}
